<template>
  <div>
    <h2>孙组件</h2>
    <p>祖组件的钱: {{ money }}万元</p>
    <p>祖组件的车子: {{ car }}</p>
    <button @click="handleUpdateMoney">操作祖组件的钱</button>
  </div>
</template>

<script lang="ts" setup>
import { inject } from 'vue'
let { money, updateMoney } = inject('moneyContext')
function handleUpdateMoney() {
  updateMoney()
}
let car = inject('car')
</script>

<style lang="scss" scoped></style>
